﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Panel.Master" Inherits="System.Web.Mvc.ViewPage<Prodma.DataAccess.Models.ViewModels.UserVm>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%=System.Configuration.ConfigurationManager.AppSettings["pageTitle"] %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<div class="listHeader">
    <img src="../../Images/ListImages/userlist.png" alt="" class="listHeaderIco" />
    <div class="listHeaderText">Sipariş Yöneticisi : <%=ViewData.Model.FirstName %>&nbsp;<%=ViewData.Model.LastName %></div>
    
    <div class="listHeaderMenuBox">
        <% Html.RenderPartial("/views/shared/userControls/acceptance.ascx",
               new Prodma.DataAccess.Models.UserControlViewModels.AcceptanceVm()
               {
                   View = "user",
                   Keys = new List<string>() { "page" },
                   Values = new List<string>() { Request.QueryString["page"] }
               }); %>
    </div>
</div>

<form method="post" action="/user/edit/">
<div class="detailContainer">
    <div class="detailSection-50pc">
        <div class="detailSectionHeader">Giriş Bilgileri</div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc">Kullanıcı Adı :</div>
            <div class="detailSectionRowText-80pc"><input type="text" id="userName" name="userName" maxlength="50" class="detailSectionControl" value='<%=ViewData.Model.UserName %>' /></div>
        </div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc">Parola :</div>
            <div class="detailSectionRowText-80pc"><input type="password" id="password" name="password" maxlength="10" class="detailSectionControl" /></div>
        </div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc">Tekrar :</div>
            <div class="detailSectionRowText-80pc"><input type="password" id="password2" name="password2" maxlength="10" class="detailSectionControl" /></div>
        </div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc"></div>
            <div class="detailSectionRowText-80pc"><input type="button" id="btnUserNameAndPasswordChanges" name="btnUserNameAndPasswordChanges" onclick="changeUserNameAndPassword();" value="Onayla" class="detailSectionControlButton" /></div>
        </div>
    </div>
    <div class="detailSection-50pc">
        <div class="detailSectionHeader">Kişisel Bilgileri</div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc">Adı :</div>
            <div class="detailSectionRowText-80pc"><input type="text" id="firstName" name="firstName" maxlength="50" class="detailSectionControl" value='<%=ViewData.Model.FirstName %>' /></div>
        </div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc">Soyadı :</div>
            <div class="detailSectionRowText-80pc"><input type="text" id="lastName" name="lastName" maxlength="50" class="detailSectionControl" value='<%=ViewData.Model.LastName %>' /></div>
        </div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc">Mail :</div>
            <div class="detailSectionRowText-80pc"><input type="text" id="mail" name="mail" maxlength="50" class="detailSectionControl" value='<%=ViewData.Model.Mail %>' /></div>
        </div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc"></div>
            <div class="detailSectionRowText-80pc" style="height:23px"></div>
        </div>
    </div>
    
    <div class="detailSection-50pc">
        <div class="detailSectionHeader">Sistem Bilgileri</div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc">Durum :</div>
            <div class="detailSectionRowText-80pc"><%=Html.DropDownList("ddlState", (SelectList)ViewData["stateList"], "Seçiniz", new { @class = "detailSectionControlCombo" })%></div>
        </div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc">Yetki :</div>
            <div class="detailSectionRowText-80pc"><%=Html.DropDownList("ddlRole", (SelectList)ViewData["roleList"], "Seçiniz", new { @class = "detailSectionControlCombo" })%></div>
        </div>
    </div>
    
    <input type="hidden" id="id" name="id" value='<%=ViewData.Model.Id %>' />
</div>
</form>

<script type="text/javascript">
    function submitForm() {
        if (userValidate()) {
            document.forms[0].submit();
        }
    }
    function changeUserNameAndPassword() {
        if (userDataValidate()) {
            var id = $('#id').val();
            var userName = $('#userName').val();
            var password = $('#password').val();

            document.location.replace('/user/changeUserNameAndPassword/?id=' + id + '&userName=' + userName + '&password=' + password);
        }
    }    
</script>

</asp:Content>
